package com.nikkerball.apps.darkhorse.model.change;

import javax.persistence.*;

/**
 * Represents the changed values of a change event
 *
 * @author marius (created on 2010-12-12)
 */

@Entity
@Table(name = "ChangeValue")
public class ChangeValue {

    // ----- instance fields -----

    private ChangeEvent changeEvent;

    private int id;

    private String label;

    private String value;

    // ----- constructors -----

    public ChangeValue(String label, String value, ChangeEvent changeEvent) {
        this.label = label;
        this.value = value;
        this.changeEvent = changeEvent;
    }

    // ----- public methods -----

    @ManyToOne
    @JoinColumn(name = "changeEvent_Id", nullable = false)
    public ChangeEvent getChangeEvent() {
        return this.changeEvent;
    }

    public void setChangeEvent(ChangeEvent changeEvent) {
        this.changeEvent = changeEvent;
    }

    @Id
    @Column(nullable = false)
    @GeneratedValue(strategy = GenerationType.AUTO)
    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(nullable = false)
    public String getLabel() {
        return this.label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Column
    public String getValue() {
        return this.value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
